package com.example.ndkjnidemo.home.exception;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.blankj.utilcode.util.LogUtils;
import com.example.ndkjnidemo.databinding.ActivityExceptionBinding;

/**
 *
 */
public class ExceptionActivity extends AppCompatActivity {

    private static final String TAG = "ExceptionActivity";
    private ActivityExceptionBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        binding = ActivityExceptionBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        //===
        onJniException();
    }

    public void onJniException() {
        JNIException jniException = new JNIException();
        jniException.nativeInvokeJavaException();
        try {
            jniException.nativeThrowException();
        } catch (Exception e) {
            e.printStackTrace();
            LogUtils.e(TAG, "nativeThrowException Exception:", e);
        }
    }
}